<?php
$to = escapestr($_REQUEST['to']);

$query = "SELECT * from users where id='" . $to ."'";
$result 				= mysql_query($query);
if (mysql_num_rows($result)){ 
	$profile_info = mysql_fetch_array($result);
	$recv	= "<div class=\"djthumb\"><a href=\"index.php?do=profile&to=".$profile_info['id']."\">".$profile_info['name']."</a><br>";
	$recv .= GetStatusImg($profile_info['status']);					
	$recv .= "<br><img src=\"index.php?do=getphoto&square=1&size=150&id=".$profile_info['photo']."\" title=\"".$profile_info['name']."\"></div>";
/*
			$djs.=	
											
											".$dj_info['name']."</a><br><br><img src=\"$img\" alt=\"$TXT_NOIMG\" 
												width=\"150\" height=\"150\"></div>";
*/

if ($_REQUEST['type']==0 ) $selcomment = 'selected';
	if ($_REQUEST['type']==2 ) $selpm = 'selected';

	$COMMENTS = '<form method="POST" ACTION="index.php?do=pm">';
	$COMMENTS .= FormatSmallElement(GetLangString($lang,"txt_messagetype"), "<select name='type' size='2'>
	<option value=\"0\"  $selcomment>".GetLangString($lang,"txt_comments")."</option>
	<option value=\"2\"  $selpm>".GetLangString($lang,"txt_pm")."</option>
</select>");
	$COMMENTS .= '<textarea name="text" rows="10"></textarea>';
	$COMMENTS .= "<input type=\"hidden\" name=\"from\" value=\"$id\">";
	$COMMENTS .= "<input type=\"hidden\" name=\"to\" value=\"$to\">";
	$COMMENTS .= "<input value=\"".GetLangString($lang,"txt_send")."\"	name = \"add\" 	type=\"submit\">" ;
	$COMMENTS .= '</form>';
	
	if (!$RENDER_MOBILE) $SITE_MIDDLE .= "<table width='100%'><tr><td width='200' valign='top'><center>";
	$SITE_MIDDLE .= FormatElement(GetLangString($lang,"txt_sendpmtp"),$recv);
	if (!$RENDER_MOBILE) $SITE_MIDDLE .= "</td><td valign='top'>";
	$SITE_MIDDLE .= FormatElement(GetLangString($lang,"txt_send"),$COMMENTS);
	if (!$RENDER_MOBILE) $SITE_MIDDLE .= "</td></tr><table>";
} else {
$SITE_MIDDLE.= FormatElement(GetLangString($lang,'txt_error'),GetLangString($lang,'msg_pmnoto'));
}
?>